.class public Lcom/netease/newsreader/util/FlingGallery;
.super Landroid/widget/FrameLayout;
.source "FlingGallery.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;,
        Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;,
        Lcom/netease/newsreader/util/FlingGallery$FlingGestureDetector;
    }
.end annotation


# instance fields
.field private mAdapter:Landroid/widget/Adapter;

.field private mAnimation:Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;

.field private mAnimationDuration:I

.field private mContext:Landroid/content/Context;

.field private mCurrentOffset:F

.field private mCurrentPosition:I

.field private mCurrentViewNumber:I

.field private mDecelerateInterpolater:Landroid/view/animation/Interpolator;

.field private mFlingDirection:I

.field private mGalleryWidth:I

.field private mGestureDetector:Landroid/view/GestureDetector;

.field private mIsDragging:Z

.field private mIsGalleryCircular:Z

.field private mIsTouched:Z

.field private mScrollTimestamp:J

.field private mSnapBorderRatio:F

.field private mViewPaddingWidth:I

.field private mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

.field private final swipe_max_off_path:I

.field private final swipe_min_distance:I

.field private final swipe_threshold_veloicty:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 6
    .parameter "context"

    .prologue
    const/4 v5, 0x0

    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 57
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 26
    const/16 v0, 0x78

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->swipe_min_distance:I

    .line 27
    const/16 v0, 0xfa

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->swipe_max_off_path:I

    .line 28
    const/16 v0, 0x190

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->swipe_threshold_veloicty:I

    .line 32
    iput v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mViewPaddingWidth:I

    .line 33
    const/16 v0, 0x1f4

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mAnimationDuration:I

    .line 34
    const/high16 v0, 0x3f00

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mSnapBorderRatio:F

    .line 35
    iput-boolean v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsGalleryCircular:Z

    .line 39
    iput v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mGalleryWidth:I

    .line 40
    iput-boolean v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsTouched:Z

    .line 41
    iput-boolean v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsDragging:Z

    .line 42
    const/4 v0, 0x0

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentOffset:F

    .line 43
    const-wide/16 v0, 0x32

    iput-wide v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mScrollTimestamp:J

    .line 44
    iput v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    .line 45
    iput v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    .line 46
    iput v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    .line 59
    iput-object p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mContext:Landroid/content/Context;

    .line 60
    iput-object v5, p0, Lcom/netease/newsreader/util/FlingGallery;->mAdapter:Landroid/widget/Adapter;

    .line 62
    const/4 v0, 0x3

    new-array v0, v0, [Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    iput-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    .line 63
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    new-instance v1, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    invoke-direct {v1, p0, v2, p0}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;-><init>(Lcom/netease/newsreader/util/FlingGallery;ILandroid/widget/FrameLayout;)V

    aput-object v1, v0, v2

    .line 64
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    new-instance v1, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    invoke-direct {v1, p0, v3, p0}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;-><init>(Lcom/netease/newsreader/util/FlingGallery;ILandroid/widget/FrameLayout;)V

    aput-object v1, v0, v3

    .line 65
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    new-instance v1, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    invoke-direct {v1, p0, v4, p0}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;-><init>(Lcom/netease/newsreader/util/FlingGallery;ILandroid/widget/FrameLayout;)V

    aput-object v1, v0, v4

    .line 67
    new-instance v0, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;-><init>(Lcom/netease/newsreader/util/FlingGallery;)V

    iput-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mAnimation:Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;

    .line 68
    new-instance v0, Landroid/view/GestureDetector;

    new-instance v1, Lcom/netease/newsreader/util/FlingGallery$FlingGestureDetector;

    invoke-direct {v1, p0, v5}, Lcom/netease/newsreader/util/FlingGallery$FlingGestureDetector;-><init>(Lcom/netease/newsreader/util/FlingGallery;Lcom/netease/newsreader/util/FlingGallery$FlingGestureDetector;)V

    invoke-direct {v0, v1}, Landroid/view/GestureDetector;-><init>(Landroid/view/GestureDetector$OnGestureListener;)V

    iput-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mGestureDetector:Landroid/view/GestureDetector;

    .line 69
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mContext:Landroid/content/Context;

    const v1, 0x10a0006

    invoke-static {v0, v1}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mDecelerateInterpolater:Landroid/view/animation/Interpolator;

    .line 70
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/util/FlingGallery;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 48
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$1(Lcom/netease/newsreader/util/FlingGallery;)Landroid/widget/Adapter;
    .locals 1
    .parameter

    .prologue
    .line 49
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mAdapter:Landroid/widget/Adapter;

    return-object v0
.end method

.method static synthetic access$10(Lcom/netease/newsreader/util/FlingGallery;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 40
    iput-boolean p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsTouched:Z

    return-void
.end method

.method static synthetic access$11(Lcom/netease/newsreader/util/FlingGallery;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 44
    iput p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    return-void
.end method

.method static synthetic access$12(Lcom/netease/newsreader/util/FlingGallery;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 41
    iput-boolean p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsDragging:Z

    return-void
.end method

.method static synthetic access$13(Lcom/netease/newsreader/util/FlingGallery;J)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 43
    iput-wide p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mScrollTimestamp:J

    return-void
.end method

.method static synthetic access$14(Lcom/netease/newsreader/util/FlingGallery;)I
    .locals 1
    .parameter

    .prologue
    .line 46
    iget v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    return v0
.end method

.method static synthetic access$15(Lcom/netease/newsreader/util/FlingGallery;F)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 42
    iput p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentOffset:F

    return-void
.end method

.method static synthetic access$16(Lcom/netease/newsreader/util/FlingGallery;)I
    .locals 1
    .parameter

    .prologue
    .line 39
    iget v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mGalleryWidth:I

    return v0
.end method

.method static synthetic access$17(Lcom/netease/newsreader/util/FlingGallery;)J
    .locals 2
    .parameter

    .prologue
    .line 43
    iget-wide v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mScrollTimestamp:J

    return-wide v0
.end method

.method static synthetic access$18(Lcom/netease/newsreader/util/FlingGallery;)F
    .locals 1
    .parameter

    .prologue
    .line 42
    iget v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentOffset:F

    return v0
.end method

.method static synthetic access$2(Lcom/netease/newsreader/util/FlingGallery;II)I
    .locals 1
    .parameter
    .parameter
    .parameter

    .prologue
    .line 200
    invoke-direct {p0, p1, p2}, Lcom/netease/newsreader/util/FlingGallery;->getViewOffset(II)I

    move-result v0

    return v0
.end method

.method static synthetic access$3(Lcom/netease/newsreader/util/FlingGallery;I)I
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 156
    invoke-direct {p0, p1}, Lcom/netease/newsreader/util/FlingGallery;->getPrevViewNumber(I)I

    move-result v0

    return v0
.end method

.method static synthetic access$4(Lcom/netease/newsreader/util/FlingGallery;)[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    return-object v0
.end method

.method static synthetic access$5(Lcom/netease/newsreader/util/FlingGallery;)I
    .locals 1
    .parameter

    .prologue
    .line 33
    iget v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mAnimationDuration:I

    return v0
.end method

.method static synthetic access$6(Lcom/netease/newsreader/util/FlingGallery;)Landroid/view/animation/Interpolator;
    .locals 1
    .parameter

    .prologue
    .line 53
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mDecelerateInterpolater:Landroid/view/animation/Interpolator;

    return-object v0
.end method

.method static synthetic access$7(Lcom/netease/newsreader/util/FlingGallery;I)I
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 161
    invoke-direct {p0, p1}, Lcom/netease/newsreader/util/FlingGallery;->getNextViewNumber(I)I

    move-result v0

    return v0
.end method

.method static synthetic access$8(Lcom/netease/newsreader/util/FlingGallery;)Z
    .locals 1
    .parameter

    .prologue
    .line 40
    iget-boolean v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsTouched:Z

    return v0
.end method

.method static synthetic access$9(Lcom/netease/newsreader/util/FlingGallery;)Z
    .locals 1
    .parameter

    .prologue
    .line 41
    iget-boolean v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsDragging:Z

    return v0
.end method

.method private getNextPosition(I)I
    .locals 2
    .parameter "relativePosition"

    .prologue
    .line 141
    add-int/lit8 v0, p1, 0x1

    .line 143
    .local v0, nextPosition:I
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getLastPosition()I

    move-result v1

    if-le v0, v1, :cond_0

    .line 145
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getLastPosition()I

    move-result v1

    add-int/lit8 v0, v1, 0x1

    .line 147
    iget-boolean v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsGalleryCircular:Z

    if-eqz v1, :cond_0

    .line 149
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getFirstPosition()I

    move-result v0

    .line 153
    :cond_0
    return v0
.end method

.method private getNextViewNumber(I)I
    .locals 1
    .parameter "relativeViewNumber"

    .prologue
    .line 163
    const/4 v0, 0x2

    if-ne p1, v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    add-int/lit8 v0, p1, 0x1

    goto :goto_0
.end method

.method private getPrevPosition(I)I
    .locals 2
    .parameter "relativePosition"

    .prologue
    .line 124
    add-int/lit8 v0, p1, -0x1

    .line 126
    .local v0, prevPosition:I
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getFirstPosition()I

    move-result v1

    if-ge v0, v1, :cond_0

    .line 128
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getFirstPosition()I

    move-result v1

    add-int/lit8 v0, v1, -0x1

    .line 130
    iget-boolean v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsGalleryCircular:Z

    if-eqz v1, :cond_0

    .line 132
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getLastPosition()I

    move-result v0

    .line 136
    :cond_0
    return v0
.end method

.method private getPrevViewNumber(I)I
    .locals 1
    .parameter "relativeViewNumber"

    .prologue
    .line 158
    if-nez p1, :cond_0

    const/4 v0, 0x2

    :goto_0
    return v0

    :cond_0
    add-int/lit8 v0, p1, -0x1

    goto :goto_0
.end method

.method private getViewOffset(II)I
    .locals 3
    .parameter "viewNumber"
    .parameter "relativeViewNumber"

    .prologue
    .line 203
    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mGalleryWidth:I

    iget v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mViewPaddingWidth:I

    add-int v0, v1, v2

    .line 206
    .local v0, offsetWidth:I
    invoke-direct {p0, p2}, Lcom/netease/newsreader/util/FlingGallery;->getPrevViewNumber(I)I

    move-result v1

    if-ne p1, v1, :cond_0

    .line 217
    .end local v0           #offsetWidth:I
    :goto_0
    return v0

    .line 212
    .restart local v0       #offsetWidth:I
    :cond_0
    invoke-direct {p0, p2}, Lcom/netease/newsreader/util/FlingGallery;->getNextViewNumber(I)I

    move-result v1

    if-ne p1, v1, :cond_1

    .line 214
    mul-int/lit8 v0, v0, -0x1

    goto :goto_0

    .line 217
    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method public getFirstPosition()I
    .locals 1

    .prologue
    .line 114
    const/4 v0, 0x0

    return v0
.end method

.method public getGalleryCount()I
    .locals 1

    .prologue
    .line 109
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mAdapter:Landroid/widget/Adapter;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mAdapter:Landroid/widget/Adapter;

    invoke-interface {v0}, Landroid/widget/Adapter;->getCount()I

    move-result v0

    goto :goto_0
.end method

.method public getLastPosition()I
    .locals 1

    .prologue
    .line 119
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getGalleryCount()I

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getGalleryCount()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    goto :goto_0
.end method

.method moveNext()V
    .locals 1

    .prologue
    .line 230
    const/4 v0, -0x1

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    .line 231
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->processGesture()V

    .line 232
    return-void
.end method

.method movePrevious()V
    .locals 1

    .prologue
    .line 223
    const/4 v0, 0x1

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    .line 224
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->processGesture()V

    .line 225
    return-void
.end method

.method public onGalleryTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 3
    .parameter "event"

    .prologue
    .line 256
    iget-object v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mGestureDetector:Landroid/view/GestureDetector;

    invoke-virtual {v1, p1}, Landroid/view/GestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    .line 258
    .local v0, consumed:Z
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    const/4 v2, 0x1

    if-ne v1, v2, :cond_1

    .line 260
    iget-boolean v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsTouched:Z

    if-nez v1, :cond_0

    iget-boolean v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsDragging:Z

    if-eqz v1, :cond_1

    .line 262
    :cond_0
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->processScrollSnap()V

    .line 263
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->processGesture()V

    .line 267
    :cond_1
    return v0
.end method

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 1
    .parameter "keyCode"
    .parameter "event"

    .prologue
    const/4 v0, 0x1

    .line 237
    packed-switch p1, :pswitch_data_0

    .line 251
    invoke-super {p0, p1, p2}, Landroid/widget/FrameLayout;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v0

    :goto_0
    return v0

    .line 240
    :pswitch_0
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->movePrevious()V

    goto :goto_0

    .line 244
    :pswitch_1
    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->moveNext()V

    goto :goto_0

    .line 237
    nop

    :pswitch_data_0
    .packed-switch 0x15
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method protected onLayout(ZIIII)V
    .locals 3
    .parameter "changed"
    .parameter "left"
    .parameter "top"
    .parameter "right"
    .parameter "bottom"

    .prologue
    const/4 v2, 0x0

    .line 169
    invoke-super/range {p0 .. p5}, Landroid/widget/FrameLayout;->onLayout(ZIIII)V

    .line 172
    sub-int v0, p4, p2

    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mGalleryWidth:I

    .line 174
    if-eqz p1, :cond_0

    .line 177
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v0, v0, v2

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-virtual {v0, v2, v2, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->setOffset(III)V

    .line 178
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    const/4 v1, 0x1

    aget-object v0, v0, v1

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-virtual {v0, v2, v2, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->setOffset(III)V

    .line 179
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    const/4 v1, 0x2

    aget-object v0, v0, v1

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-virtual {v0, v2, v2, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->setOffset(III)V

    .line 181
    :cond_0
    return-void
.end method

.method processGesture()V
    .locals 6

    .prologue
    const/4 v5, 0x0

    .line 272
    iget v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    .line 273
    .local v0, newViewNumber:I
    const/4 v2, 0x0

    .line 274
    .local v2, reloadViewNumber:I
    const/4 v1, 0x0

    .line 276
    .local v1, reloadPosition:I
    iput-boolean v5, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsTouched:Z

    .line 277
    iput-boolean v5, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsDragging:Z

    .line 279
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    if-lez v3, :cond_1

    .line 281
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getFirstPosition()I

    move-result v4

    if-gt v3, v4, :cond_0

    iget-boolean v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsGalleryCircular:Z

    if-eqz v3, :cond_1

    .line 284
    :cond_0
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getPrevViewNumber(I)I

    move-result v0

    .line 285
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getPrevPosition(I)I

    move-result v3

    iput v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    .line 286
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getNextViewNumber(I)I

    move-result v2

    .line 287
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getPrevPosition(I)I

    move-result v1

    .line 291
    :cond_1
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    if-gez v3, :cond_3

    .line 293
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getLastPosition()I

    move-result v4

    if-lt v3, v4, :cond_2

    iget-boolean v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsGalleryCircular:Z

    if-eqz v3, :cond_3

    .line 296
    :cond_2
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getNextViewNumber(I)I

    move-result v0

    .line 297
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getNextPosition(I)I

    move-result v3

    iput v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    .line 298
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getPrevViewNumber(I)I

    move-result v2

    .line 299
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->getNextPosition(I)I

    move-result v1

    .line 303
    :cond_3
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    if-eq v0, v3, :cond_4

    .line 305
    iput v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    .line 308
    iget-object v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v3, v3, v2

    invoke-virtual {v3, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->recycleView(I)V

    .line 312
    :cond_4
    iget-object v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    iget v4, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    aget-object v3, v3, v4

    invoke-virtual {v3}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->requestFocus()V

    .line 315
    iget-object v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mAnimation:Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;

    iget v4, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-virtual {v3, v4}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;->prepareAnimation(I)V

    .line 316
    iget-object v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mAnimation:Lcom/netease/newsreader/util/FlingGallery$FlingGalleryAnimation;

    invoke-virtual {p0, v3}, Lcom/netease/newsreader/util/FlingGallery;->startAnimation(Landroid/view/animation/Animation;)V

    .line 319
    iput v5, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    .line 320
    return-void
.end method

.method processScrollSnap()V
    .locals 5

    .prologue
    .line 325
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mGalleryWidth:I

    int-to-float v3, v3

    iget v4, p0, Lcom/netease/newsreader/util/FlingGallery;->mSnapBorderRatio:F

    mul-float v1, v3, v4

    .line 326
    .local v1, rollEdgeWidth:F
    iget v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mGalleryWidth:I

    float-to-int v4, v1

    sub-int v2, v3, v4

    .line 327
    .local v2, rollOffset:I
    iget-object v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    iget v4, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    aget-object v3, v3, v4

    invoke-virtual {v3}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->getCurrentOffset()I

    move-result v0

    .line 329
    .local v0, currentOffset:I
    mul-int/lit8 v3, v2, -0x1

    if-gt v0, v3, :cond_0

    .line 332
    const/4 v3, 0x1

    iput v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    .line 335
    :cond_0
    if-lt v0, v2, :cond_1

    .line 338
    const/4 v3, -0x1

    iput v3, p0, Lcom/netease/newsreader/util/FlingGallery;->mFlingDirection:I

    .line 340
    :cond_1
    return-void
.end method

.method public setAdapter(Landroid/widget/Adapter;)V
    .locals 5
    .parameter "adapter"

    .prologue
    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 185
    iput-object p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mAdapter:Landroid/widget/Adapter;

    .line 186
    iput v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    .line 187
    iput v2, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    .line 190
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v0, v0, v2

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->recycleView(I)V

    .line 191
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v0, v0, v3

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v1}, Lcom/netease/newsreader/util/FlingGallery;->getNextPosition(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->recycleView(I)V

    .line 192
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v0, v0, v4

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v1}, Lcom/netease/newsreader/util/FlingGallery;->getPrevPosition(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->recycleView(I)V

    .line 195
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v0, v0, v2

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-virtual {v0, v2, v2, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->setOffset(III)V

    .line 196
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v0, v0, v3

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-virtual {v0, v2, v2, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->setOffset(III)V

    .line 197
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    aget-object v0, v0, v4

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-virtual {v0, v2, v2, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->setOffset(III)V

    .line 198
    return-void
.end method

.method public setAnimationDuration(I)V
    .locals 0
    .parameter "animationDuration"

    .prologue
    .line 79
    iput p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mAnimationDuration:I

    .line 80
    return-void
.end method

.method public setIsGalleryCircular(Z)V
    .locals 2
    .parameter "isGalleryCircular"

    .prologue
    .line 89
    iget-boolean v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsGalleryCircular:Z

    if-eq v0, p1, :cond_1

    .line 91
    iput-boolean p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mIsGalleryCircular:Z

    .line 93
    iget v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getFirstPosition()I

    move-result v1

    if-ne v0, v1, :cond_0

    .line 96
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-direct {p0, v1}, Lcom/netease/newsreader/util/FlingGallery;->getPrevViewNumber(I)I

    move-result v1

    aget-object v0, v0, v1

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v1}, Lcom/netease/newsreader/util/FlingGallery;->getPrevPosition(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->recycleView(I)V

    .line 99
    :cond_0
    iget v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-virtual {p0}, Lcom/netease/newsreader/util/FlingGallery;->getLastPosition()I

    move-result v1

    if-ne v0, v1, :cond_1

    .line 102
    iget-object v0, p0, Lcom/netease/newsreader/util/FlingGallery;->mViews:[Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentViewNumber:I

    invoke-direct {p0, v1}, Lcom/netease/newsreader/util/FlingGallery;->getNextViewNumber(I)I

    move-result v1

    aget-object v0, v0, v1

    iget v1, p0, Lcom/netease/newsreader/util/FlingGallery;->mCurrentPosition:I

    invoke-direct {p0, v1}, Lcom/netease/newsreader/util/FlingGallery;->getNextPosition(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/util/FlingGallery$FlingGalleryView;->recycleView(I)V

    .line 105
    :cond_1
    return-void
.end method

.method public setPaddingWidth(I)V
    .locals 0
    .parameter "viewPaddingWidth"

    .prologue
    .line 74
    iput p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mViewPaddingWidth:I

    .line 75
    return-void
.end method

.method public setSnapBorderRatio(F)V
    .locals 0
    .parameter "snapBorderRatio"

    .prologue
    .line 84
    iput p1, p0, Lcom/netease/newsreader/util/FlingGallery;->mSnapBorderRatio:F

    .line 85
    return-void
.end method
